<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title th:inline="text">简历列表 @ [[${serverInfo}]]
    </title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--    <link href="<c:url value="/lib/bootstrap/css/bootstrap.css"/>" rel="stylesheet">-->
    <!--    <script src="<c:url value="/lib/jquery-3.4.1.min.js"/>"></script>-->
    <!--    <script src="<c:url value="/lib/bootstrap/js/bootstrap.js"/>"></script>-->
<!--    <link th:href="@{/lib/bootstrap/css/bootstrap.css}" rel="stylesheet"/>-->
<!--    <script th:href="@{/lib/jquery-3.4.1.min.js}"></script>-->
<!--    <script th:href="@{/lib/bootstrap/js/bootstrap.js}"></script>-->

    <style>
        html, body {
            height: 100%
        }
    </style>
    <script th:inline="javascript">
        function remove(id) {
            if (confirm("确认删除该简历？")) {
                let link = /*[[@{/resume/delete}]]*/;
                location.href = link + '/' + id + '.do';
            }
        }

        function logout() {
            location.href = /*[[@{/logout.do}]]*/
        }
    </script>
</head>
<body class="bg-secondary">
<div class="container h-100 d-flex justify-content-center">
    <div class=" my-auto">
        <div style="text-align: right">
            <button class="btn btn-primary" onclick="location.href='create.do'">新建</button>
            &nbsp;
            <button class="btn btn-primary" onclick="logout()">注销
            </button>
        </div>
        <table class="table table-hover" style="width: 1000px;margin-top: 10px">
            <thead class="thead-dark">
            <tr>
                <th style="width: 100px">ID</th>
                <th>姓名</th>
                <th style="width: 150px">操作</th>
            </tr>
            </thead>
            <tbody class="bg-white">
            <div th:each="r: ${list}">
                <tr>
                    <td>
                        <div th:text="${r.id}"/>

                    </td>
                    <td>
                        <div th:text="${r.name}"/>
                    </td>
                    <td>
                        <a href="#" class="font-weight-bold" th:onclick="@{'remove('+${r.id}+')'}">删除</a>
                        <a th:href="@{'/resume/'+${r.id}+'.do'}" class="font-weight-bold">编辑</a>
                    </td>
                </tr>
            </div>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>
